package com.cxyxj.beandemo;

import com.cxyxj.beandemo.impl.ProductServiceImpl;
import com.cxyxj.beandemo.impl.UserServiceImpl;
import org.springframework.context.annotation.*;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Configuration
public class BeanConfig {

    @Bean(name = {"u1","u2"})
    public UserServiceImpl u(){
        UserServiceImpl userService = new UserServiceImpl();
        System.out.println("u = " + userService);
        return userService;
    }

 /*   @Bean("u")
    public UserServiceImpl u1(){
        UserServiceImpl userService = new UserServiceImpl("cxyxj");
        System.out.println("u1 = " + userService);
        return userService;
    }

    @Bean("u")
    @Order(1)
    public UserServiceImpl u2(){
        UserServiceImpl userService = new UserServiceImpl("cxyxj","1@163.com");
        System.out.println("u2 = " + userService);
        return userService;
    }*/


}
